<?php
	if(is_single()){

		if ( is_active_sidebar( 'sidebar-product' ) ){
		?>
		<div class="slider_part">
		<h5 class="slider_part_title">严选产品</h5>
		<?php
			dynamic_sidebar( 'sidebar-product' );
		}
		?>
		</div>

<?php	}

?>





<div class="slider_part">
	<h5 class="slider_part_title">最新产品</h5>
	<ul>
		<?php
			$args=array(
				'cat' => 30,   // 分类ID
				'posts_per_page' => 3, // 显示篇数
			);
			query_posts($args);
			if(have_posts()) : while (have_posts()) : the_post();
		?>
		<li>
			<a  href="<?php the_permalink(); ?>" target="_blank">
				<img class="img-fluid responsive" src="<?php echo  wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "Full")[0];?>" alt="">
				<p class="shenglue"><?php echo  get_the_title(); ?></p>
			</a>
		</li>
		<?php  endwhile; endif; wp_reset_query(); ?>  
	</ul>
</div>


<?php
	if(is_category()){

		if ( is_active_sidebar( 'sidebar-article' ) ){
		?>
		<div class="slider_part2">
		<?php
			dynamic_sidebar( 'sidebar-article' );
		}
		?>
		</div>

<?php	}

?>
